//
//  BiLoginParser.m
//  TrunkIndustryManageSystem
//
//  Created by fanbo on 15/4/17.
//  Copyright (c) 2015年 李璐西. All rights reserved.
//

#import "BiLoginParser.h"
#import "JSONKit.h"

@implementation BiLoginParser

SINGLE_INSTANCE_IMPLEMENTION(BiLoginParser);

+(BiUserEntity *) parserUserEntity:(NSString *)jsonStr
{
    NSDictionary * jsonDic = [jsonStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
    
    NSDictionary * loginDic = jsonDic[@"data"];
    
    BiUserEntity * entity = [BiUserEntity sharedInstance];
    
    entity.resultinfo = jsonDic[@"result_info"];
    
    entity.responseStatus = jsonDic[@"response_status"];
    
    if (loginDic) {
        
        entity.access_token = loginDic[@"access_token"];
        
        entity.userid = loginDic[@"id"];
        
        entity.name = loginDic[@"name"];
    }
    
    return entity;

}

@end
